package com.gxu.sjjg;
import java.io.*;
public class Main{
    public static  void main(String[] args)throws IOException {
        new Login();
        File fmanager =new File("src/file/manager.txt"),Grade=new File("src/file/Grade.txt");
        //初始化文件，如果没有则创建文件，并添加原始信息
        if(!fmanager.exists()){
            String title1[]={"用户名：admin","密码：1024"};//初始密码
            BufferedWriter inbf=new BufferedWriter(new FileWriter(fmanager));
            for(String x:title1){
                inbf.write(x);
                inbf.newLine();
            }
            inbf.close();
        }
        if(!Grade.exists()){
            String title1[]={"姓名","学号","语文","数学","英语","体育"};//将表头加入文件第一行
            BufferedWriter inbf=new BufferedWriter(new FileWriter(Grade));
            for(String x:title1){
                int len=9-x.length();
                inbf.write(x);
                for(int i=0;i<len;i++)
                    inbf.write(" ");//不足9个字符则后补0
            }
            inbf.newLine();
            inbf.close();
            
        }
    }
}
